package com.gxgeek.order.enums;

import lombok.Getter;

/**
 * Created by gx on 2017/7/12.
 */
@Getter
public enum  OrderStatusEnum implements CodeEnum{
    NEW(0,"新订单"),
    FINISHED(1,"完成"),
    CANCEL(2,"取消");

    private Integer code;
    private String msg;



    OrderStatusEnum(int code, String msg) {
        this.code=code;
        this.msg=msg;

    }
    public static  OrderStatusEnum getOrderStatusEnum(Integer code){
        for (OrderStatusEnum orderStatusEnum :OrderStatusEnum.values()){
            if (orderStatusEnum.code.intValue()==code.intValue()){
                return orderStatusEnum;
            }
        }
        return null;
    }
}
